{template 'common/header'}
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo create_url('index/welcome/' . $do);}">概况</a></li>
	<li><a href="{php echo create_url('index/sysinfo/' . $do);}">系统信息</a></li>
</ul>
<div class="alert alert-success" style="margin:5px 10px;">在themes/web/style1/home/welcome.html可自定当前风格的模板</div>
<div class="main">
	<div style="padding:15px 15px 0 15px;">
		{if $do == 'global'}
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="width:100px;">名称</th>
					<th style="width:80px;">类型</th>
					<th style="width:150px;">粉丝</th>
					<th style="width:150px;">规则</th>
					<th style="width:150px;">请求数</th>
					<th style="width:300px;">功能</th>
					<th style="min-width:51px;">操作</th>
				</tr>
			</thead>
			{loop $wechats $item}
			<tr>
				<td>{$item['name']}</td>
				<td>{if !empty($item['key']) && !empty($item['secret'])}<span class="label label-info">服务号{else}<span class="label label-success">订阅号{/if}</span></td>
				<td>
					<p>总粉丝：{$item['fans']['total']}<p>
					<p>当日增加：{$item['fans']['todayjoin']}<p>
					<p>当日流失：{$item['fans']['todayquit']}<p>
				</td>
				<td>
					<p>基本文字：{$item['rule']['basic']}<p>
					<p>图文混合：{$item['rule']['news']}<p>
					<p>基本语音：{$item['rule']['music']}<p>
					<p>其它：{$item['rule']['other']}<p>
				</td>
				<td>
					<p>总请求：{$item['response']['total']}<p>
					<p>当月请求：{$item['response']['month']}<p>
					<p>当日请求：{$item['response']['today']}<p>
				</td>
				<td class="funcmenus" weid="{$item['weid']}">
					<p><a href="{php echo create_url('rule')}">规则管理</a>&nbsp;|&nbsp;<a href="{php echo create_url('setting/category')}">分类管理</a>&nbsp;|&nbsp;<a href="{php echo create_url('member/module')}">模块管理</a></p>
					<p><a href="{php echo create_url('rule/post')}">添加规则</a>&nbsp;|&nbsp;<a href="{php echo create_url('menu')}">自定义菜单设置</a>&nbsp;|&nbsp;<a href="{php echo create_url('rule/system')}">系统回复设置</a></p>
					<p><a href="{php echo create_url('site/style')}">风格管理</a>&nbsp;|&nbsp;<a href="{php echo create_url('site/nav')}">导航管理</a></p>
				</td>
				<td>
					<p><a href="{php echo create_url('account/post', array('id' => $item['weid']))}">编辑</a>&nbsp;|&nbsp;<a href="{php echo create_url('account/switch', array('id' => $item['weid']))}">切换</a></p>
				</td>
			</tr>
			{/loop}
		</table>
		<script type="text/javascript">
		<!--
			$('.funcmenus').each(function(){
				var weid = $(this).attr('weid');
				$(this).find('a').each(function(){
					$(this).click(function(){
						var url = $(this).attr('href');
						ajaxopen('account.php?act=switch&id='+weid, function(s){
							location.href = url;
							$('#current-account', window.parent.document).html(s);
							return false;
						});
						return false;
					});
				});
			});
		//-->
		</script>
		{else}
		<div class="welcome">
			<h4><i class="icon-user"></i> 公众号信息</h4>
			<div class="item">
				<img class="img-polaroid pull-left" style="margin-right:20px" src="{$_W[attachurl]}/headimg_{$_W['weid']}.jpg?weid={$_W['account']['weid']}" width="85" onerror="$(this).remove();" />
				<div class="pull-left">
					<p><b style="font-size:16px;">{$_W['account']['name']}</b></p>
					<p><span style="width:80px;display:inline-block;">接口地址：</span>{$_W['siteroot']}api.php?hash={$_W['account']['hash']}</p>
					<p><span style="width:80px;display:inline-block;">Token：</span>{$_W['account']['token']}</p>
				</div>
			</div>
			<h4><i class="icon-plane"></i> 快捷操作</h4>
			<div class="item fast-set">
				<a href="{php echo create_url('site/module/switch', array('name' => 'userapi'))}"><i class="icon-cogs"></i><span>自定义接口</span></a>
				<a href="{php echo create_url('site/module/display', array('name' => 'fans'))}"><i class="icon-wrench"></i><span>粉丝管理</span></a>
				<!--a href="#"><i class="icon-credit-card"></i><span>会员卡</span></a-->
				<a href="{php echo create_url('site/module/display', array('name' => 'business'))}"><i class="icon-group"></i><span>商户管理</span></a>
				<a href="{php echo create_url('rule/display', array('module' => 'wxwall'))}"><i class="icon-desktop"></i><span>微信墙</span></a>
			</div>
		</div>
		<table class="table">
			<tr><th colspan="2" class="alert alert-info">可用模块</th></tr>
			{loop $modules $module}
			<tr>
				<th style="width:250px;">
					<p>{$_W['modules'][$module['name']]['title']}</p>
					{if !empty($_W['modules'][$module['name']]['isrulefields'])}
					<p><a href="{php echo create_url('rule/post', array('module' => $module['name']))}">添加规则</a></p>
					{/if}
				</th>
				<td>
					{if empty($_W['modules'][$module['name']]['isrulefields'])}
					此模块无规则
					{else}
					<p>规则数：{$module['rule']}</p>
					<p>当日触发数：{$module['response']['today']}</p>
					<p>当月触发数：{$module['response']['month']}</p>
					{/if}
				</td>
			</tr>
			{/loop}
		</table>
		{/if}
		{if $_W['isfounder']}
		<table class="table">
			<tr><th colspan="2" class="alert alert-info">微擎开发团队</th></tr>
			<tr>
				<th style="width:250px;">版权所有</th>
				<td><a href="http://www.we7.cc/" target="_blank"><b>We7 Team</b></a></td>
			</tr>
			<tr>
				<th>Team 成员</th>
				<td>
					<a href="javascript:;" class="lightlink2 smallfont" target="_blank">任超 (米粥)</a>; &nbsp;
					<a href="javascript:;" class="lightlink2 smallfont" target="_blank">袁文涛</a>; &nbsp;
					<a href="javascript:;" class="lightlink2 smallfont" target="_blank">潘韦东 (大树桩)</a>
				</td>
			</tr>
			<tr>
				<th style="width:250px;">官方交流群</th>
				<td><a target="_blank" href="http://wp.qq.com/wpa/qunwpa?idkey=874aa2f28317557b6f0874692c927974611b0c193c9b36ab17b64f9cbd43e5ad">32385562</a></td>
			</tr>
			<tr>
				<th>相关链接</th>
				<td>
					<a href="http://www.we7.cc/" class="lightlink2" target="_blank">公司网站</a>,
					<a href="http://www.we7.cc/purchase.html" class="lightlink2" target="_blank">购买授权</a>,
					<a href="http://bbs.we7.cc/forum.php?mod=forumdisplay&fid=36" class="lightlink2" target="_blank">更多模块</a>,
					<a href="http://www.we7.cc/docs/" class="lightlink2" target="_blank">文档</a>,
					<a href="http://bbs.we7.cc/" class="lightlink2" target="_blank">讨论区</a>
				</td>
			</tr>
		</table>
		{/if}
	</div>
</div>
{template 'common/footer'}
